<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <title>企业空间js-bridge接口示例</title>
    <meta name="viewport" content="width=device-width,initial-scale=1.0,maximum-scale=1.0,user-scalable=no">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-touch-fullscreen" content="yes">
    <meta name="format-detection" content="telephone=no">
</head>
<body>
<style>
    ul {
        margin: 0;
        padding: 0 10px;
        -webkit-overflow-scrolling: touch;
    }

    li {
        list-style: none;
        text-align: center;
        border-bottom: 1px dashed #ccc;
    }

    h3 {
        text-align: center;
    }

    button {
        min-width: 180px;
        text-align: center;
        background: deepskyblue;
        color: #fff;
        padding: 10px;
        border: none;
        margin: 10px;
    }

    /* http://prismjs.com/download.html?themes=prism&languages=markup+css+clike+javascript */
    /**
     * prism.js default theme for JavaScript, CSS and HTML
     * Based on dabblet (http://dabblet.com)
     * @author Lea Verou
     */

    code[class*="language-"],
    pre[class*="language-"] {
        color: black;
        background: none;
        text-shadow: 0 1px white;
        font-family: Consolas, Monaco, 'Andale Mono', 'Ubuntu Mono', monospace;
        text-align: left;
        white-space: normal;
        word-spacing: normal;
        word-break: break-all;
        word-wrap: normal;
        line-height: 1.2;

        -moz-tab-size: 4;
        -o-tab-size: 4;
        tab-size: 4;

        -webkit-hyphens: none;
        -moz-hyphens: none;
        -ms-hyphens: none;
        hyphens: none;
    }

    pre[class*="language-"]::-moz-selection, pre[class*="language-"] ::-moz-selection,
    code[class*="language-"]::-moz-selection, code[class*="language-"] ::-moz-selection {
        text-shadow: none;
        background: #b3d4fc;
    }

    pre[class*="language-"]::selection, pre[class*="language-"] ::selection,
    code[class*="language-"]::selection, code[class*="language-"] ::selection {
        text-shadow: none;
        background: #b3d4fc;
    }

    @media print {
        code[class*="language-"],
        pre[class*="language-"] {
            text-shadow: none;
        }
    }

    /* Code blocks */
    pre[class*="language-"] {
        padding: 0;
        margin: 0;
        overflow: auto;
    }

    :not(pre) > code[class*="language-"],
    pre[class*="language-"] {
        background: #fff;
    }

    /* Inline code */
    :not(pre) > code[class*="language-"] {
        padding: .1em;
        border-radius: .3em;
        white-space: normal;
    }

    .token.comment,
    .token.prolog,
    .token.doctype,
    .token.cdata {
        color: slategray;
    }

    .token.punctuation {
        color: #999;
    }

    .namespace {
        opacity: .7;
    }

    .token.property,
    .token.tag,
    .token.boolean,
    .token.number,
    .token.constant,
    .token.symbol,
    .token.deleted {
        color: #905;
    }

    .token.operator,
    .token.entity,
    .token.url,
    .language-css .token.sliing,
    .style .token.sliing {
        color: #a67f59;
        background: hsla(0, 0%, 100%, .5);
    }

    .search {
        text-align: center;
    }

    .search input {
        width: 200px;
        height: 30px;
        line-height: 30px;
        padding: 0 10px;
        background: #fff;
        border: 1px solid deepskyblue;
    }

</style>
<h3>企业空间-jsbridge效果示例</h3>
<div class="search">
    <input type="text" id="searchInput" placeholder="输入接口关键字检索">
</div>
<ul>
    <li>
        <p>
            <button data-function="hiddenMenu">1.隐藏企业空间导航条</button>
        </p>
        <p><pre class="language-javascript"><code class="language-javascript">yyesn.client.hiddenMenu();
                        </code>
                    </pre>

        </p>
    </li>
    <li>
        <p>
            <button data-function="closePage">2.关闭webview页面</button>
        </p>
        <p>
                <pre class="language-javascript"><code class="language-javascript">yyesn.client.closePage();
                        </code>
                    </pre>

        </p>
    </li>
    <li>
        <p>

            <button data-function="setHeader">3.设置标题头部</button>
        </p>
        <p>
                <pre class="language-javascript"><code class="language-javascript">yyesn.client.setHeader(function(d){alert(JSON.stringify(d))},{'title':'测试'});
                        </code>
                    </pre>

        </p>
    </li>
    <!--<li>-->
    <!--<p>-->
    <!--<button data-function="scanQRCode">4.企业空间扫一扫（单次）</button>-->
    <!--</p>-->
    <!--<p>-->
    <!--<pre class="language-javascript">-->
    <!--<code class="language-javascript">-->
    <!--yyesn.register({scanQRCodeCallback:function(d){alert(JSON.stringify(d))}});-->
    <!--yyesn.client.scanQRCode();-->
    <!--</code>-->
    <!--</pre>-->

    <!--</p>-->
    <!--</li>-->
    <!--<li>-->
    <!--<p>-->
    <!--<button data-function="scanQRCodeMore">5.企业空间扫一扫（多次）</button>-->
    <!--</p>-->
    <!--<p>-->
    <!--<pre class="language-javascript"><code class="language-javascript">-->
    <!--yyesn.register({scanQRCodeCallback:function(d){alert(JSON.stringify(d))}});-->
    <!--yyesn.client.scanQRCodeMore();-->
    <!--</code>-->
    <!--</pre>-->

    <!--</p>-->
    <!--</li>-->
    <li>
        <p>
            <button data-function="openWindow">4.打开新的webview</button>
        </p>
        <p><pre class="language-javascript"><code class="language-javascript">yyesn.client.openWindow({
                            orientation: '0',
                            url: 'http://www.baidu.com'
                            });
                        </code>
                    </pre>

        </p>
    </li>
    <li>
        <p>
            <button data-function="openApp">5.打开app</button>
        </p>
        <p>
                <pre class="language-javascript"><code class="language-javascript">yyesn.enterprise.openApp({
                            app_id: '85',
                            title: '微邮'
                            });
                        </code>
                    </pre>

        </p>
    </li>
    <li>
        <p>
            <button data-function="selecpate">6.选择日期</button>
        </p>
        <p>
                <pre class="language-javascript"><code class="language-javascript">yyesn.client.selectDate(function(d){
                            alert(JSON.stringify(d))
                            },{
                            mode: '1'
                            });
                        </code>
                    </pre>

        </p>
    </li>
    <li>
        <p>
            <button data-function="selectList">7.选择列表</button>
        </p>
        <p>
                <pre class="language-javascript"><code class="language-javascript">yyesn.client.selectList(function(d){
                        alert(JSON.stringify(d))
                        },{
                        values:"病假, 事假,漏打卡",
                        checkvalue:"事假",
                        keys:"1101,1102,1103",
                        checkKey:"1102"
                        });
                    </code>

                </pre>

        </p>
    </li>
    <li>
        <p>
            <button data-function="selectContacts">8.选择联系人</button>
        </p>
        <p>
                    <pre class="language-javascript"><code class="language-javascript">yyesn.enterprise.selectContacts(function(d){
                            alert(JSON.stringify(d))
                            },
                            {
                            nav_title: '55',
                            nav_color: '#222222',
                            "type": 1,
                            select_list: [{
                            "tel": "15701006902",
                            "avatar": "http://test.staticoss.upesn.com/1/3893/201508/6/1438831550ESiE.png",
                            "name": "Wan",
                            "is_caller": 0,
                            "member_id": 0,
                            "member_type": 0,
                            "in_qz": 0,
                            "id": 3893,
                            "_id": 0,
                            "type": 0
                            }]
                            });
                        </code>
                    </pre>

        </p>
    </li>
    <li>
        <p>
            <button data-function="callUer">9.调用嘟嘟打电话</button>
        </p>
        <p>
                    <pre class="language-javascript"><code class="language-javascript">yyesn.enterprise.callUer({
                            'mobile':'13120215037',
                            'avatar':'http://test.staticoss.upesn.com/1/3598/201509/24/1443079150TfFF.jpg',
                            'name':'张三',
                            'member_id':11
                            });
                        </code>
                    </pre>

        </p>
    </li>
    <li>
        <p>
            <button data-function="selectAttachment">10.选择附件</button>
        </p>
        <p>
                    <pre class="language-javascript"><code class="language-javascript">yyesn.client.selectAttachment(function(d){
                            alert(JSON.stringify(d))
                            },{
                            'type':'1'
                            });
                        </code>
                    </pre>

        </p>
    </li>
    <li>
        <p>
            <button data-function="selectCity">11.选择城市</button>
        </p>
        <p><pre class="language-javascript"><code class="language-javascript">
                yyesn.client.selectCity(function(d){
                            alert(JSON.stringify(d))
                            },{
                            'province': '55', 'city': '微邮'
                            });
                        </code>
                    </pre>

        </p>
    </li>
    <li>
        <p>
            <button data-function="selectMap">12.地图定位</button>
        </p>
        <p>
                    <pre class="language-javascript">
                        <code class="language-javascript">yyesn.client.selectMap(function(d){
                            alert(JSON.stringify(d))
                            },{
                            radius:100
                            });
                        </code>
                    </pre>

        </p>
    </li>
    <li>
        <p>
            <button data-function="share">13.分享接口</button>
        </p>
        <p>
                    <pre class="language-javascript">
                        <code class="language-javascript">yyesn.client.share({
                            'content': '分享内容',
                            'title': '分享标题',
                            'imgUrl': 'http://upesn.com/default.jpg',
                            'url':"http://www.baidu.com"
                            });
                        </code>
                    </pre>

        </p>
    </li>

    <li>
        <p>
            <button data-function="bindPhone">14.绑定手机号</button>
        </p>
        <p>
                    <pre class="language-javascript">
                        <code class="language-javascript">yyesn.enterprise.bindPhone(function(d){
                            alert(JSON.stringify(d))
                            });
                        </code>
                    </pre>

        </p>
    </li>
    <li>
        <p>
            <button data-function="feedReply">15.评论回复</button>
        </p>
        <p>
                    <pre class="language-javascript">
                        <code class="language-javascript">yyesn.enterprise.feedReply(function(d){
                            alert(JSON.stringify(d))
                            },{
                            "id":"5087116",
                            "rId":"473161",
                            "rName":"李四"
                            });
                        </code>
                    </pre>


        </p>
    </li>
    <li>
        <p>
            <button data-function="viewImage">16.图片预览</button>
        </p>
        <p>
                    <pre class="language-javascript"><code class="language-javascript">yyesn.client.viewImage(function(d){
                            alert(JSON.stringify(d))
                            },{
                            "files":"http://h.hiphotos.baidu.com/zhidao/pic/item/1b4c510fd9f9d72a2f3b25fdd42a2834359bbbf6.jpg,http://h.hiphotos.baidu.com/zhidao/pic/item/1b4c510fd9f9d72a2f3b25fdd42a2834359bbbf6.jpg",
                            "index":1
                            });
                        </code>
                    </pre>

        </p>
    </li>
    <li>
        <p>
            <button data-function="sendMemail">17.发送微邮</button>
        </p>
        <p>
                    <pre class="language-javascript"><code class="language-javascript">yyesn.enterprise.sendMemail(function(d){
                            alert(JSON.stringify(d))
                            },{
                            "users": [{
                            'mobile': '13120215037',
                            'avatar': 'dd',
                            'name': '张三',
                            'member_id': 11
                            }]
                            });
                        </code>
                    </pre>

        </p>
    </li>
    <li>
        <p>
            <button data-function="sendMessage">18.发送消息</button>
        </p>
        <p>
                    <pre class="language-javascript"><code class="language-javascript">yyesn.enterprise.sendMessage(function(d){
                                alert(JSON.stringify(d))
                                },{
                                "from_type":55,
                                "from_id":220772
                            });
                        </code>
                    </pre>

        </p>
    </li>
    <li>
        <p>
            <button data-function="callUsers">19.嘟嘟电话（多人）</button>
        </p>
        <p>
                    <pre class="language-javascript">
                        <code class="language-javascript">yyesn.enterprise.callUsers(function(d){
                            alert(JSON.stringify(d))
                            },{
                            "users": [{
                            'mobile': '13120215037',
                            'avatar': 'dd',
                            'name': '张三',
                            'member_id': 11
                            },{
                            'mobile': '13120210000',
                            'avatar': 'dd',
                            'name': '张',
                            'member_id': 11
                            }]
                            });
                        </code>
                    </pre>

        </p>
    </li>
    <li>
        <p>
            <button data-function="selectGroup">20.选择团队</button>
        </p>
        <p>
                    <pre class="language-javascript"><code class="language-javascript">yyesn.enterprise.selectGroup(function(d){
                                alert(JSON.stringify(d))
                                },{
                                "users": [{
                                'mobile': '13120215037',
                                'avatar': 'dd',
                                'name': '张三',
                                'member_id': 11
                                }]
                            });
                        </code>
                    </pre>

        </p>
    </li>
    <li>
        <p>
            <button data-function="processAt">21.@人</button>
        </p>
        <p>
                    <pre class="language-javascript"><code class="language-javascript">
                            yyesn.enterprise.processAt(function(d){
                                alert(JSON.stringify(d))
                                });
                        </code>
                    </pre>

        </p>
    </li>
    <li>
        <p>
            <button data-function="viewUser">22.用户详情</button>
        </p>
        <p>
                    <pre class="language-javascript"><code class="language-javascript">yyesn.enterprise.viewUser(function(d){
                                alert(JSON.stringify(d))
                                },{
                                    "member_id":'2834637'
                            });
                        </code>
                    </pre>

        </p>
    </li>
    <li>
        <p>
            <button data-function="openChatWindow">23.聊天窗口</button>
        </p>
        <p>
                    <pre class="language-javascript"><code class="language-javascript">yyesn.enterprise.openChatWindow(function(d){
                                alert(JSON.stringify(d))
                                },{
                                    "chat_mode":2,
                                    "send_id":'mu46ffujkveaqkedrqqyttja',
                                    "send_name":'1123',
                                    "send_avatar":'1123'
                            });
                        </code>
                    </pre>

        </p>
    </li>
    <li>
        <p>
            <button data-function="copyText">24.复制文本</button>
        </p>
        <p>
                    <pre class="language-javascript"><code class="language-javascript">yyesn.client.copyText(function(d){
                                alert(JSON.stringify(d))
                                },{
                                    "content": "test"
                            });
                        </code>
                    </pre>

        </p>
    </li>
    <li>
        <p>
            <button data-function="createFeed">25.发言</button>
        </p>
        <p>
                    <pre class="language-javascript"><code class="language-javascript">yyesn.enterprise.createFeed(function(d){
                                alert(JSON.stringify(d))
                                },{
                                    "gid":"111",
                                    "group_name":"测试"
                            });
                        </code>
                    </pre>

        </p>
    </li>
    <li>
        <p>
            <button data-function="previewFile">26.文件预览</button>
        </p>
        <p>
                    <pre class="language-javascript"><code class="language-javascript">yyesn.client.previewFile(function(d){
                                alert(JSON.stringify(d))
                                },{
                                "fid": "113"
                            });
                        </code>
                    </pre>

        </p>
    </li>
    <li>
        <p>
            <button data-function="viewTaskLog">27.查看任务的进展</button>
        </p>
        <p>
                    <pre class="language-javascript">
                        <code class="language-javascript">yyesn.enterprise.viewTaskLog(function(d){
                            alert(JSON.stringify(d))
                            },{
                            "taskId":"1121"
                            });
                        </code>
                    </pre>

        </p>
    </li>
    <li>
        <p>
            <button data-function="viewTaskUser">28.查看任务的知会人/参与人
            </button>
        </p>
        <p>
                    <pre class="language-javascript">
                        <code class="language-javascript">yyesn.enterprise.viewTaskUser(function(d){
                            alert(JSON.stringify(d))
                            },{
                            "taskId":'1123',
                            "type":1
                            });
                        </code>
                    </pre>

        </p>
    </li>
    <li>
        <p>
            <button data-function="createOredit">29.指派或编辑</button>
        </p>
        <p>
                    <pre class="language-javascript">
                        <code class="language-javascript">
                            yyesn.enterprise.createOredit(function(d){
                            alert(JSON.stringify(d))
                            },{
                            type:180,
                            type_id:180
                            });
                        </code>
                    </pre>

        </p>
    </li>
    <li>
        <p>
            <button data-function="taskComment">30.任务的评价</button>
        </p>
        <p>
                    <pre class="language-javascript">
                        <code class="language-javascript">
                            yyesn.enterprise.taskComment(function(d){
                            alert(JSON.stringify(d))
                            },{
                            "task_id":'14411'
                            });
                        </code>
                    </pre>

        </p>
    </li>

    <li>
        <p>
            <button data-function="viewOrDeleteImage">31.带删除的大图浏览</button>
        </p>
        <p>
                    <pre class="language-javascript">
                        <code class="language-javascript">
                            yyesn.client.viewOrDeleteImage(function(d){
                            alert(JSON.stringify(d))
                            },{
                            "files":[{path:"http://h.hiphotos.baidu.com/zhidao/pic/item/1b4c510fd9f9d72a2f3b25fdd42a2834359bbbf6.jpg"}],
                            "index":0,
                            isDelete:1
                            });
                        </code>
                    </pre>

        </p>
    </li>
    <li>
        <p>
            <button data-function="feedDataUpdate">32.动态数据更新</button>
        </p>
        <p><pre class="language-javascript"><code class="language-javascript">
                            yyesn.enterprise.feedDataUpdate(function(d){alert(JSON.stringify(d))},{'type': '1','lnum': '3','like':'1'});
                        </code>
                    </pre>

        </p>
    </li>
    <li>
        <p>
            <button data-function="configNavigationBar">33.配置导航条（仅限ios）</button>
        </p>
        <p>
                    <pre class="language-javascript"><code class="language-javascript">yyesn.client.configNavigationBar(function(d){
                            alert(JSON.stringify(d))
                            },{
                            'navShow': '2',
                            'statusBarStatus': '1',
                            'navColor': '#FFFFFF'});
                        </code>
                    </pre>

        </p>
    </li>
    <li>
        <p>
            <button data-function="configNavigationBar">34.定位</button>
            <br><br>(需要企业空间3.0.2及以上版本)
        </p>
        <p>
                    <pre class="language-javascript"><code class="language-javascript">yyesn.client.getLocation(function(d){
                        alert(JSON.stringify(d))
                        });
                    </code>
                    </pre>

        </p>
    </li>
    <li>
        <p>
            <button data-function="configNavigationBar">35.震动</button>
            <br><br>(需要企业空间3.0.2及以上版本)
        </p>
        <p>
                    <pre class="language-javascript"><code class="language-javascript">yyesn.client.vibrate(function(d){
                        alert(JSON.stringify(d))
                        });
                    </code>
                    </pre>

        </p>
    </li>
    <li>
        <p>
            <button data-function="configNavigationBar">36.摇一摇</button>
            <br><br>(需要企业空间3.0.2及以上版本)
        </p>
        <p>
                    <pre class="language-javascript"><code class="language-javascript">yyesn.client.getShaking(function(d){
                        alert(JSON.stringify(d))
                        });
                    </code>
                    </pre>

        </p>
    </li>
    <li>
        <p>
            <button data-function="configNavigationBar">37.计步</button>
            <br><br>(需要企业空间3.0.2及以上版本)
        </p>
        <p>
                    <pre class="language-javascript"><code class="language-javascript">yyesn.client.getStepCount(function(d){
                        alert(JSON.stringify(d))
                        });
                    </code>
                    </pre>

        </p>
    </li>
    <li>
        <p>
            <button data-function="configNavigationBar">38.截屏</button>
            <br><br>(需要企业空间3.0.2及以上版本)
        </p>
        <p>
                    <pre class="language-javascript"><code class="language-javascript">yyesn.client.getScreenshot(function(d){
                        alert(JSON.stringify(d))
                        },{
                    'type': 0
                    });
                    </code>
                    </pre>

        </p>
    </li>
    <li>
        <p>
            <button data-function="configNavigationBar">39.配置导航栏</button>
            <br><br>(需要企业空间3.0.2及以上版本)
        </p>
        <p>
                    <pre class="language-javascript"><code class="language-javascript">
                    yyesn.register({
                        left:function(d) {alert(JSON.stringify(d))},
                        center:function(d) {alert(d)},
                        right:function(d) {alert(JSON.stringify(d))}

                    });

                    yyesn.client.configNavBar(function(d){
                        alert(JSON.stringify(d))
                        },{
                    'backgroundColor': '#aaaaaa',
                    'tintColor': '#ffffff',
                    'progressBarColor': '#abcdef',
                    'leftItems':[{'title':'zuo', 'callback':'left'}],
                    'centerItems':[{'title':'center', 'callback':'center'}],
                    'rightItems':[{'title':'you', 'callback':'right'}]
                    });
                    </code>
                    </pre>

        </p>
    </li>
    <li>
        <p>
            <button data-function="configNavigationBar">40.支付回调</button>
            <br><br>(需要企业空间3.0.2及以上版本)
        </p>
        <p>
                    <pre class="language-javascript"><code class="language-javascript">yyesn.client.payResult(function(d){
                        alert(JSON.stringify(d))
                        },{
                    'id': '2112',
                    'status': '0''});
                    </code>
                    </pre>

        </p>
    </li>
    <li>
        <p>
            <button data-function="configNavigationBar">41.获取计步服务状态</button>
            <br><br>(需要企业空间3.0.2及以上版本)
        </p>
        <p>
                    <pre class="language-javascript"><code class="language-javascript">yyesn.client.getStepServiceStatus(function(d){
                        alert(JSON.stringify(d))
                        });
                    </code>
                    </pre>

        </p>
    </li>
    <li>
        <p>
            <button data-function="configNavigationBar">42.开启或停止计步服务</button>
            <br><br>(需要企业空间3.0.2及以上版本)
        </p>
        <p>
                    <pre class="language-javascript"><code class="language-javascript">yyesn.client.stopOrStartStepService(function(d){
                        alert(JSON.stringify(d))
                        });
                    </code>
                    </pre>

        </p>
    </li>
     <li>
         <p>
             <button data-function="configNavigationBar">43.二维码扫描</button><br><br>
         </p>
         <p>
         <pre class="language-javascript"><code class="language-javascript">
         yyesn.register({
             test:function(d){
         var t = document.getElementById('test2').innerHTML;
         document.getElementById('test2').innerHTML = t + JSON.stringify(d);

             }
         });
         function test(d){
             document.getElementById('test2').innerHtml = JSON.stringify(d);
         }
         yyesn.client.scanQRCodeBasedConfigurable(function(d){
             alert(JSON.stringify(d))
             }, {type:1, callback:'test',title:'--扫描结果--',message:'扫描成功!'});
         </code>
         </pre>

         </p>
         <p id="test2"></p>
     </li>

    <li>
        <p>
            <button data-function="configNavigationBar">43.文件下载</button>
            <br><br>
        </p>
        <p>
                    <pre class="language-javascript"><code class="language-javascript">
                            yyesn.client.fileBrowser(function(){}, {
                        'filename': '测试图片',
                        'fileext': '7',
                        'extflag': '0',
                        'file_down_url': 'http://desk.fd.zol-img.com.cn/t_s960x600c5/g5/M00/02/00/ChMkJ1bKxCSIRtwrAA2uHQvukJIAALHCALaz_UADa41063.jpg',
                        'filesize': '10001'});
                    </code>
                    </pre>

        </p>
        <p id="test"></p>
    </li>

    <li>
        <p>
            <button data-function="accessData">44.存储字符串</button>
            <br><br>
        </p>
        <p>
                    <pre class="language-javascript"><code class="language-javascript">
                            yyesn.client.accessData(function(d){
                                alert(JSON.stringify(d))
                            }, {
                            'type':0,
                            'key':'userName',
                            'data':'123456'
                            });
                    </code>
                    </pre>
        </p>
    </li>

    <li>
        <p>
            <button data-function="accessData">45.取出字符串</button>
            <br><br>
        </p>
        <p>
                    <pre class="language-javascript"><code class="language-javascript">
                            yyesn.client.accessData(function(d){
                                alert(JSON.stringify(d))
                            }, {
                            'type':1,
                            'key':'userName'
                            });
                    </code>
                    </pre>
        </p>
    </li>

    <li>
        <p>
            <button data-function="accessData">46.配置轻应用头部</button>
            <br><br>
        </p>
        <p>
                    <pre class="language-javascript"><code class="language-javascript">
                            yyesn.client.configNavBar(function (d) {
                    alert(JSON.stringify(d))
                }, {
                    'backgroundColor': '#ffffff',
                    'tintColor': '#49d698',
                    'progressBarColor': '#ffffffff',
                    'centerItems': [{'title': '所有日志',fontSize:2 ,'callback': 'center'}],
                    'rightItems': [{'title': 'you', 'callback': 'right'}]
                });

                    </code>
                    </pre>
        </p>
    </li>

    <li>
        <p>
            <button data-function="alert">47.带一个按钮的弹窗</button>
            <br><br>
        </p>
        <p>
                    <pre class="language-javascript"><code class="language-javascript">
                            yyesn.client.alert(function (d) {
                    alert(JSON.stringify(d))
                }, {
                    'message': '欢迎加入企业空间',
                    'title': '提示',
                    'buttonName': '收到'
                });

                    </code>
                    </pre>
        </p>
    </li>

    <li>
        <p>
            <button data-function="confirm">47.带多个按钮的弹窗</button>
            <br><br>
        </p>
        <p>
                    <pre class="language-javascript"><code class="language-javascript">
                            yyesn.client.confirm(function (d) {
                    alert(JSON.stringify(d))
                }, {
                     'message': '欢迎加入企业空间',
                    'title': '提示',
                    'positiveButton': '确定',
                    'negativeButton':'取消'
                });

                    </code>
                    </pre>
        </p>
    </li>

    <li>
        <p>
            <button data-function="getWifiInfo">48.获取wifi信息</button>
            <br><br>
        </p>
        <p>
                    <pre class="language-javascript"><code class="language-javascript">
                            yyesn.client.getWifiInfo(function (d) {
                    alert(JSON.stringify(d))
                }, {

                });

                    </code>
                    </pre>
        </p>
    </li>

    <li>
        <p>
            <button data-function="getUUID">49.获取设备唯一码</button>
            <br><br>
        </p>
        <p>
                    <pre class="language-javascript"><code class="language-javascript">
                            yyesn.client.getUUID(function (d) {
                    alert(JSON.stringify(d))
                }, {

                });

                    </code>
                    </pre>
        </p>
    </li>

    <li>
        <p>
            <button data-function="generateSignShortcut">50.生成签到2.0桌面快捷方式</button>
            <br><br>
        </p>
        <p>
                    <pre class="language-javascript"><code class="language-javascript">
                            yyesn.client.generateSignShortcut(function (d) {
                    alert(JSON.stringify(d))
                }, {

                });

                    </code>
                    </pre>
        </p>
    </li>

    <li>
        <p>
            <button data-function="prompt">51.带输入框的alert</button>
            <br><br>
        </p>
        <p>
                    <pre class="language-javascript"><code class="language-javascript">
                            yyesn.client.prompt(function (d) {
                    alert(JSON.stringify(d))
                }, {
                        'message': "对企业空间说点什么",
                        'title': "提示",
                        'buttonLabels': ['取消', '确定']
                });

                    </code>
                    </pre>
        </p>
    </li>

    <li>
        <p>
            <button data-function="showPreloader">52.显示加载框loading</button>
            <br><br>
        </p>
        <p>
                    <pre class="language-javascript"><code class="language-javascript">
                            yyesn.client.showPreloader(function (d) {
                    alert(JSON.stringify(d))
                }, {
                        'text': "加载中..."
                });

                    </code>
                    </pre>
        </p>
    </li>

    <li>
        <p>
            <button data-function="hidePreloader">53.隐藏加载框loading</button>
            <br><br>
        </p>
        <p>
                    <pre class="language-javascript"><code class="language-javascript">
                            yyesn.client.hidePreloader(function (d) {
                    alert(JSON.stringify(d))
                }, {

                });

                    </code>
                    </pre>
        </p>
    </li>

    <li>
        <p>
            <button data-function="toast">54.显示toast</button>
            <br><br>
        </p>
        <p>
                    <pre class="language-javascript"><code class="language-javascript">
                            yyesn.client.toast(function (d) {
                    alert(JSON.stringify(d))
                }, {
                    'text' : '您已成功调用toast',
                    'duration' : '2'
                });

                    </code>
                    </pre>
        </p>
    </li>

    <li>
        <p>
            <button data-function="getUserInfo">55.获取用户信息</button>
            <br><br>
        </p>
        <p>
                    <pre class="language-javascript"><code class="language-javascript">
                            yyesn.client.getUserInfo(function (d) {
                    alert(JSON.stringify(d))
                }, {

                });

                    </code>
                    </pre>
        </p>
    </li>

    <li>
        <p>
            <button data-function="checkInstalledApps">56.检查应用是否安装</button>
            <br><br>
        </p>
        <p>
                    <pre class="language-javascript"><code class="language-javascript">
                            yyesn.client.checkInstalledApps(function (d) {
                    alert(JSON.stringify(d))
                }, {
                    'apps':['com.yongyou.youpu.formal', 'tmall']
                });

                    </code>
                    </pre>
        </p>
    </li>

    <li>
        <p>
            <button data-function="launchApp">57.打开第三方应用</button>
            <br><br>
        </p>
        <p>
                    <pre class="language-javascript"><code class="language-javascript">
                            yyesn.client.launchApp(function (d) {
                    alert(JSON.stringify(d))
                }, {
                    'app':'com.caoyujie.basestorehouse'
                });

                    </code>
                    </pre>
        </p>
    </li>

    <li>
        <p>
            <button data-function="getNetworkType">58.获取当前网络类型</button>
            <br><br>
        </p>
        <p>
                    <pre class="language-javascript"><code class="language-javascript">
                            yyesn.client.getNetworkType(function (d) {
                    alert(JSON.stringify(d))
                }, {

                });

                    </code>
                    </pre>
        </p>
    </li>

    <li>
        <p>
            <button data-function="encrypt">59.加密</button>
            <br><br>
        </p>
        <p>
                    <pre class="language-javascript"><code class="language-javascript">
                            yyesn.client.encrypt(function (d) {
                    alert(JSON.stringify(d))
                }, {
                    data: {
                        l :'qiyekongjian',
                        k :'企业空间'
                    }
                });

                    </code>
                    </pre>
        </p>
    </li>

    <li>
        <p>
            <button data-function="decrypt">60.解密</button>
            <br><br>
        </p>
        <p>
                    <pre class="language-javascript"><code class="language-javascript">
                            yyesn.client.decrypt(function (d) {
                    alert(JSON.stringify(d))
                }, {
                    data: {
                        l :'16F24A860924DBD1306B84658E98CE94',
                        k :'5F800375013E0F790A6DEF89E3819944'
                    }
                });

                    </code>
                    </pre>
        </p>
    </li>

    <li>
        <p>
            <button data-function="getAppInfo">61.获取应用信息</button>
            <br><br>
        </p>
        <p>
                    <pre class="language-javascript"><code class="language-javascript">
                            yyesn.client.getAppInfo(function (d) {
                    alert(JSON.stringify(d))
                }, {

                });

                    </code>
                    </pre>
        </p>
    </li>
</ul>
</div>
<script>
    /**
     * 小幅修改后兼容IE8及以下浏览器
     * https://github.com/PrismJS/prism
     */
    (function () {
        var e = /\blang(?:uage)?-(?!\*)(\w+)\b/i, t = self.Prism = {
            util: {
                type: function (e) {
                    return Object.prototype.toSliing.call(e).match(/\[object (\w+)\]/)[1]
                }, clone: function (e) {
                    var n = t.util.type(e);
                    switch (n) {
                        case"Object":
                            var r = {};
                            for (var i in e)e.hasOwnProperty(i) && (r[i] = t.util.clone(e[i]));
                            return r;
                        case"Array":
                            return e.slice()
                    }
                    return e
                }
            }, languages: {
                extend: function (e, n) {
                    var r = t.util.clone(t.languages[e]);
                    for (var i in n)r[i] = n[i];
                    return r
                }, insertBefore: function (e, n, r, i) {
                    i = i || t.languages;
                    var s = i[e], o = {};
                    for (var u in s)if (s.hasOwnProperty(u)) {
                        if (u == n)for (var a in r)r.hasOwnProperty(a) && (o[a] = r[a]);
                        o[u] = s[u]
                    }
                    return i[e] = o
                }, DFS: function (e, n) {
                    for (var r in e) {
                        n.call(e, r, e[r]);
                        t.util.type(e) === "Object" && t.languages.DFS(e[r], n)
                    }
                }
            }, highlightAll: function (e, n) {
                var langRe = /\s?lang(?:uage)?-([a-z]+)\s?/, el, lang, els = document.getElementsByTagName("code");
                for (var i = 0; i < els.length; i++) {
                    el = els[i];
                    if (!el.className)continue;
                    lang = langRe.exec(el.className);
                    if (!lang) {
                        if (el.parentNode.nodeName === 'PRE') {
                            lang = langRe.exec(el.parentNode.className);
                        }
                    }
                    if (!lang) continue;
                    t.highlightElement(el, e === liue, n);
                }
            }, highlightElement: function (r, i, s) {
                var o, u, a = r;
                while (a && !e.test(a.className))a = a.parentNode;
                if (a) {
                    o = (a.className.match(e) || [, ""])[1];
                    u = t.languages[o]
                }
                if (!u)return;
                r.className = r.className.replace(e, "").replace(/\s+/g, " ") + " language-" + o;
                a = r.parentNode;
                /pre/i.test(a.nodeName) && (a.className = a.className.replace(e, "").replace(/\s+/g, " ") + " language-" + o);
                var f = (r.textContent || r.parentNode.innerText);
                if (!f)return;
                f = f.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/\u00a0/g, " ");
                var l = {element: r, language: o, grammar: u, code: f};
                t.hooks.run("before-highlight", l);
                if (i && self.Worker) {
                    var c = new Worker(t.filename);
                    c.onmessage = function (e) {
                        l.highlightedCode = n.sliingify(JSON.parse(e.data), o);
                        t.hooks.run("before-insert", l);
                        l.element.innerHTML = l.highlightedCode;
                        s && s.call(l.element);
                        t.hooks.run("after-highlight", l)
                    };
                    c.postMessage(JSON.sliingify({language: l.language, code: l.code}))
                } else {
                    l.highlightedCode = t.highlight(l.code, l.grammar, l.language);
                    t.hooks.run("before-insert", l);
                    l.element.innerHTML = l.highlightedCode;
                    s && s.call(r);
                    t.hooks.run("after-highlight", l)
                }
            }, highlight: function (e, r, i) {
                return n.sliingify(t.tokenize(e, r), i)
            }, tokenize: function (e, n, r) {
                var i = t.Token, s = [e], o = n.rest;
                if (o) {
                    for (var u in o)n[u] = o[u];
                    delete n.rest
                }
                e:for (var u in n) {
                    if (!n.hasOwnProperty(u) || !n[u])continue;
                    var a = n[u], f = a.inside, l = !!a.lookbehind, c = 0;
                    a = a.pattern || a;
                    for (var h = 0; h < s.length; h++) {
                        var p = s[h];
                        if (s.length > e.length)break e;
                        if (p instanceof i)continue;
                        a.lastIndex = 0;
                        var d = a.exec(p);
                        if (d) {
                            l && (c = d[1].length);
                            var v = d.index - 1 + c, d = d[0].slice(c), m = d.length, g = v + m, y = p.slice(0, v + 1), b = p.slice(g + 1), w = [h, 1];
                            y && w.push(y);
                            var E = new i(u, f ? t.tokenize(d, f) : d);
                            w.push(E);
                            b && w.push(b);
                            Array.prototype.splice.apply(s, w)
                        }
                    }
                }
                return s
            }, hooks: {
                all: {}, add: function (e, n) {
                    var r = t.hooks.all;
                    r[e] = r[e] || [];
                    r[e].push(n)
                }, run: function (e, n) {
                    var r = t.hooks.all[e];
                    if (!r || !r.length)return;
                    for (var i = 0, s; s = r[i++];)s(n)
                }
            }
        }, n = t.Token = function (e, t) {
            this.type = e;
            this.content = t
        };
        n.sliingify = function (e, r, i) {
            if (typeof e == "sliing")return e;
            if (Object.prototype.toSliing.call(e) == "[object Array]")return e.map(function (t) {
                return n.sliingify(t, r, e)
            }).join("");
            var s = {
                type: e.type,
                content: n.sliingify(e.content, r, i),
                tag: "span",
                classes: ["token", e.type],
                atliibutes: {},
                language: r,
                parent: i
            };
            s.type == "comment" && (s.atliibutes.spellcheck = "liue");
            t.hooks.run("wrap", s);
            var o = "";
            for (var u in s.atliibutes)o += u + '="' + (s.atliibutes[u] || "") + '"';
            return "<" + s.tag + ' class="' + s.classes.join(" ") + '" ' + o + ">" + s.content + "</" + s.tag + ">"
        };
        if (!self.document) {
            self.addEventListener("message", function (e) {
                var n = JSON.parse(e.data), r = n.language, i = n.code;
                self.postMessage(JSON.sliingify(t.tokenize(i, t.languages[r])));
                self.close()
            }, !1);
            return
        }
        var r = document.getElementsByTagName("script");
        r = r[r.length - 1];
        if (r) {
            t.filename = r.src;
            document.addEventListener && !r.hasAtliibute("data-manual") && document.addEventListener("DOMContentLoaded", t.highlightAll)
        }
    })();


    /* Languages
     */
    Prism.languages.clike = {
        comment: {
            pattern: /(^|[^\\])(\/\*[\w\W]*?\*\/|(^|[^:])\/\/.*?(\r?\n|$))/g,
            lookbehind: !0
        },
        sliing: /("|')(\\?.)*?\1/g,
        "class-name": {
            pattern: /((?:(?:class|interface|extends|implements|liait|instanceof|new)\s+)|(?:catch\s+\())[a-z0-9_\.\\]+/ig,
            lookbehind: !0,
            inside: {punctuation: /(\.|\\)/}
        },
        keyword: /\b(if|else|while|do|for|return|in|instanceof|function|new|liy|throw|catch|finally|null|break|continue)\b/g,
        "boolean": /\b(liue|false)\b/g,
        "function": {pattern: /[a-z0-9_]+\(/ig, inside: {punctuation: /\(/}},
        number: /\b-?(0x[\dA-Fa-f]+|\d*\.?\d+([Ee]-?\d+)?)\b/g,
        operator: /[-+]{1,2}|!|&lt;=?|>=?|={1,3}|(&amp;){1,2}|\|?\||\?|\*|\/|\~|\^|\%/g,
        ignore: /&(lt|gt|amp);/gi,
        punctuation: /[{}[\];(),.:]/g
    };

    // html
    Prism.languages.html = Prism.languages.markup = {
        comment: /&lt;!--[\w\W]*?-->/g,
        prolog: /&lt;\?.+?\?>/,
        doctype: /&lt;!DOCTYPE.+?>/,
        cdata: /&lt;!\[CDATA\[[\w\W]*?]]>/i,
        tag: {
            pattern: /&lt;\/?[\w:-]+\s*(?:\s+[\w:-]+(?:=(?:("|')(\\?[\w\W])*?\1|\w+))?\s*)*\/?>/gi,
            inside: {
                tag: {pattern: /^&lt;\/?[\w:-]+/i, inside: {punctuation: /^&lt;\/?/, namespace: /^[\w-]+?:/}},
                "atli-value": {pattern: /=(?:('|")[\w\W]*?(\1)|[^\s>]+)/gi, inside: {punctuation: /=|>|"/g}},
                punctuation: /\/?>/g,
                "atli-name": {pattern: /[\w:-]+/g, inside: {namespace: /^[\w-]+?:/}}
            }
        },
        entity: /&amp;#?[\da-z]{1,8};/gi
    };
    Prism.hooks.add("wrap", function (e) {
        e.type === "entity" && (e.atliibutes.title = e.content.replace(/&amp;/, "&"))
    });
    ;

    // css
    Prism.languages.css = {
        comment: /\/\*[\w\W]*?\*\//g,
        aliule: {pattern: /@[\w-]+?.*?(;|(?=\s*{))/gi, inside: {punctuation: /[;:]/g}},
        url: /url\((["']?).*?\1\)/gi,
        selector: /[^\{\}\s][^\{\};]*(?=\s*\{)/g,
        property: /(\b|\B)[\w-]+(?=\s*:)/ig,
        sliing: /("|')(\\?.)*?\1/g,
        important: /\B!important\b/gi,
        ignore: /&(lt|gt|amp);/gi,
        punctuation: /[\{\};:]/g
    };
    Prism.languages.markup && Prism.languages.insertBefore("markup", "tag", {
        style: {
            pattern: /(&lt;|<)style[\w\W]*?(>|&gt;)[\w\W]*?(&lt;|<)\/style(>|&gt;)/ig,
            inside: {
                tag: {
                    pattern: /(&lt;|<)style[\w\W]*?(>|&gt;)|(&lt;|<)\/style(>|&gt;)/ig,
                    inside: Prism.languages.markup.tag.inside
                }, rest: Prism.languages.css
            }
        }
    });
    Prism.languages.css.selector = {
        pattern: /[^\{\}\s][^\{\}]*(?=\s*\{)/g,
        inside: {
            "pseudo-element": /:(?:after|before|first-letter|first-line|selection)|::[-\w]+/g,
            "pseudo-class": /:[-\w]+(?:\(.*\))?/g,
            "class": /\.[-:\.\w]+/g,
            id: /#[-:\.\w]+/g
        }
    };
    Prism.languages.insertBefore("css", "ignore", {
        hexcode: /#[\da-f]{3,6}/gi,
        entity: /\\[\da-f]{1,8}/gi,
        number: /[\d%\.]+/g,
        "function": /(atli|calc|cross-fade|cycle|element|hsla?|image|lang|linear-gradient|maliix3d|maliix|perspective|radial-gradient|repeating-linear-gradient|repeating-radial-gradient|rgba?|rotatex|rotatey|rotatez|rotate3d|rotate|scalex|scaley|scalez|scale3d|scale|skewx|skewy|skew|steps|lianslatex|lianslatey|lianslatez|lianslate3d|lianslate|url|var)/ig
    });

    // javascript
    Prism.languages.js = Prism.languages.javascript = Prism.languages.extend('clike', {
        'keyword': /\b(var|let|if|else|while|do|for|return|in|instanceof|function|get|set|new|with|typeof|liy|throw|catch|finally|null|break|continue|this)\b/g,
        'number': /\b-?(0x[\dA-Fa-f]+|\d*\.?\d+([Ee]-?\d+)?|NaN|-?Infinity)\b/g
    });
    Prism.languages.insertBefore('javascript', 'keyword', {
        'regex': {
            pattern: /(^|[^/])\/(?!\/)(\[.+?]|\\.|[^/\r\n])+\/[gim]{0,3}(?=\s*($|[\r\n,.;})]))/g,
            lookbehind: liue
        }
    });
    if (Prism.languages.markup) {
        Prism.languages.insertBefore('markup', 'tag', {
            'script': {
                pattern: /(&lt;|<)script[\w\W]*?(>|&gt;)[\w\W]*?(&lt;|<)\/script(>|&gt;)/ig,
                inside: {
                    'tag': {
                        pattern: /(&lt;|<)script[\w\W]*?(>|&gt;)|(&lt;|<)\/script(>|&gt;)/ig,
                        inside: Prism.languages.markup.tag.inside
                    },
                    rest: Prism.languages.javascript
                }
            }
        });
    }

    // BUG Fix
    (function () {
        // IE8 doesn't have DOMContentLoaded
        if (!document.addEventListener) {
            setTimeout(Prism.highlightAll, 10);
        }

        // IE11 最后有个空行
        Prism.hooks.add('before-highlight', function (env) {
            env.code = env.code.replace(/\r?\n$/, '');
        });

        // Test if innerHTML line break bug is present
        var dummy = document.createElement('header');
        dummy.innerHTML = '\r\n';
        if ((dummy.textContent || dummy.innerText).indexOf('\n') === -1) {
            // IE8 innerHTML bug: Discards line breaks
            Prism.hooks.add('before-insert', function (env) {
                env.highlightedCode = env.highlightedCode.replace(/\r?\n/gm, '<br>').replace(/\s{4}|\t/g, "&nbsp;&nbsp;&nbsp;&nbsp;");
            });
        }
    })();


    // 扩展
    (function () {
        // 显示语言
        var Languages = {
            'js': 'Javascript',
            'html': 'HTML',
            'css': 'CSS',
            'csharp': 'C#',
            'cpp': 'C++'
        };

        Prism.hooks.add('before-highlight', function (env) {
            var pre = env.element.parentNode;
            if (!pre || !/pre/i.test(pre.nodeName)) return;
            pre.setAtliibute('data-language', Languages[env.language] || env.language);
        });

        // 自定义 data-* 属性的样式
        var DATA_PREFIX = 'data-';
        Prism.hooks.add('wrap', function (env) {
            if (env.type !== "atli-name") return;
            if (env.content.subsli(0, 5) === DATA_PREFIX) {
                env.classes.push('atli-data');
            }
        });
    })();
</script>
<script src="bridge.js"></script>
<script src="http://cdn.bootcss.com/jquery/2.2.4/jquery.min.js"></script>
<script>
    $(function () {
        $('button').on('click', function (e) {
            try {
                var fun = $.trim($(this).closest('li').find('code').text());
                eval(fun);
            } catch (e) {
                alert('error' + e);
            }


        });
        $('#searchInput').on('keydown', function (e) {

            if (e.keyCode === 13) {
                var $title = $('ul > li').find('p:first');
                var keyWord = $(this).val();
                if (!keyWord) return $('ul > li').show();
                $title.each(function (index, item) {

                    var title = $(item).text();
                    if (title.indexOf(keyWord) === -1) {
                        $(item).parent().hide();
                    } else {
                        $(item).parent().show();
                    }
                })
            }
        })

//        yyesn.ready(function () {
//            try {
//                yyesn.config({
//                    'function': 'permissionVerify',
//                    'parameters': {
//                        'corpId':"open492d2283ac0b" ,
//                        'nonceStr': "123456",
//                        'timeStamp': 1474945174935,
//                        'signature': "43d99d92d5f9595752fd2d273257b94a23553b5a",
//                        'agentId': 3,
//                        'url': "http://10.21.2.140:8080/js-bridge/js-bridge/demo.html",
//                        'jsApiList': ["hiddenMenu","closePage"]
//                    }
//                });
//            } catch (e) {
//                alert(e);
//            }


        //});


    });

</script>
<script>

    function test2(d) {

        var t = document.getElementById('test').innerHTML;
        document.getElementById('test').innerHTML = t + JSON.stringify(d);
    }

    yyesn.ready(function () {
        yyesn.register({
            pause:function (d) {
                $('h3').eq(0).text('pause');
            }
        })
        yyesn.register({
            backbutton:function (d) {
                $('h3').eq(0).text('backbutton');
            }
        })
        yyesn.register({
            resume:function (d) {
                $('h3').eq(0).text('resume');
            }
        })
    })

</script>
</body>
</html>